package javaweb.servlet.impl;

import javaweb.dao.impl.UserDaoImpl;
import javaweb.pojo.User;
import javaweb.servlet.UserSrvlt;

/**
 * @author shkstart
 * @creat -07-14 18:42
 */
public class UserServletImpl implements UserSrvlt {
UserDaoImpl userDao=new UserDaoImpl();
    @Override
    public void registUser(User user) {
        userDao.svaeUser(user);
    }

    @Override
    public User logUser(User user) {
return  userDao.queryUsernameAndPassword(user.getUsername(),user.getPassword());
    }

    @Override
    public Boolean checkUserName(String username) {
        if (userDao.queryUsername(username)==null){
            return false;
        }
   return true;
    }


}
